package main

import "github.com/gin-gonic/gin"

func SetStatic(en *gin.Engine, info map[string]interface{}) {
	// 注册静态资源文件夹
	if dir, ok := info["dir"].(map[string]interface{}); ok {
		for key, value := range dir {
			if str, ok := value.(string); ok {
				en.Static(key, str)
			}
		}
	}
	// 注册单个文件
	if dir, ok := info["file"].(map[string]interface{}); ok {
		for key, value := range dir {
			if str, ok := value.(string); ok {
				en.StaticFile(key, str)
			}
		}
	}
}
